﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Model.Test.Webforms._Default" %>

<%@ Register TagPrefix="cc1" Namespace="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet"
    Assembly="Microsoft.Practices.EnterpriseLibrary.Validation.Integration.AspNet" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <table>
        <tr>
            <td>First name</td>
            <td>
                <asp:TextBox ID="firstNameTextBox" runat="server"></asp:TextBox>
                <cc1:PropertyProxyValidator
                    ID="firstNameValidator" runat="server" ControlToValidate="firstNameTextBox" 
                    PropertyName="FirstName"
                    RulesetName="RuleSetA" ForeColor="Red" SourceTypeName="Model.Customer"   
                    DisplayMode="SingleParagraph">
                </cc1:PropertyProxyValidator>
            </td>
        </tr>
        <tr>
            <td>Last name</td>
            <td>
                <asp:TextBox ID="lastNameTextBox" runat="server"></asp:TextBox>
                <cc1:PropertyProxyValidator ID="lastNameValidator" runat="server" 
                    ControlToValidate="lastNameTextBox" ForeColor="Red"
                    PropertyName="LastName" RulesetName="RuleSetA" SourceTypeName="Model.Customer"   
                    DisplayMode="SingleParagraph" OnValueConvert="LastNameConvert">
                </cc1:PropertyProxyValidator>
            </td>
        </tr>
         <tr>
            <td>Low mark</td>
            <td>
                <asp:TextBox ID="lowMarkTextBox" runat="server"></asp:TextBox>
                <cc1:PropertyProxyValidator ID="PropertyProxyValidator1" runat="server" 
                    ControlToValidate="lowMarkTextBox" ForeColor="Red"
                    PropertyName="LowMark" RulesetName="RuleSetA" SourceTypeName="Model.Customer"   
                    DisplayMode="SingleParagraph" OnValueConvert="LastNameConvert">
                </cc1:PropertyProxyValidator>
            </td>
        </tr>
        <tr>
            <td>High mark</td>
            <td>
                <asp:TextBox ID="highMarkTextBox" runat="server"></asp:TextBox>
                <cc1:PropertyProxyValidator ID="PropertyProxyValidator2" runat="server" 
                    ControlToValidate="highMarkTextBox" ForeColor="Red"
                    PropertyName="HighMark" RulesetName="RuleSetA" SourceTypeName="Model.Customer"   
                    DisplayMode="SingleParagraph" OnValueConvert="LastNameConvert">
                </cc1:PropertyProxyValidator>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
            </td>
        </tr>
        <tr>

          <asp:CustomValidator id="CustomValidator1" runat="server"          Display="None" EnableClientScript="False"></asp:CustomValidator> 
         <asp:ValidationSummary ID="ValidationSummary1" runat="server"  
		        ShowMessageBox="true" 
		        ShowSummary="true" 
		        HeaderText="The following errors occurred:"
		        DisplayMode="BulletList" />

       
        </tr>
    </table>
</asp:Content>
